
import  {xsEntity} from '../commentity';
import { Column ,Entity ,ManyToOne, OneToMany} from 'typeorm';
import { ClassifyEntity } from '../classify/classify';
import { NovelPartEntity } from '../part/part';

/**
 * 描述
 */
 @Entity()
export class NovelEntity extends xsEntity {
  @Column({ comment: '小说名' ,default:null })
    name: string;

    @Column({comment :"小说编号" ,default:null})
    novelsSn:string;
    @Column({comment :"作者" ,default:null})
    author:string;




    // @Column({comment :"所属分类Id"})
    // categoryId:number;
    @ManyToOne(() => ClassifyEntity, ClassifyEntity => ClassifyEntity.id)
    categoryId: ClassifyEntity;

    @Column({comment :"关键词",default:null})
    keywords:string;
    
    

    @Column({comment :"小说描述",default:null ,type:"longtext" })
    brief:string;
    
  
    @Column({comment :"作者介绍",default:null ,type:"longtext"})
    authorIntroduction:string;
    @Column({comment :"作者介绍",default:null ,type:"longtext"})
    evaluate:string;
    @Column({comment :"评分",default:null ,type:"double",scale:1})
    lv:number;

    
    @Column({comment :"售卖顺序",default:null})
    sortOrder:number;
    
    @Column({comment :"是否热卖",default:false})
    isHot:boolean;
    
    @Column({comment :"封面",type:"longtext", default:null})
    picUrl:string;
    
    
    @Column({comment :"是否新品",default:null})
    isNew:true;
    
    @Column({ comment: '',default:0, type:"double",scale:2 })
    Price: number;
    


    @Column({comment :"浏览量",default:0})
    browse:number;
    @Column({comment :"评价数量",default:0})
    evaluateNum:number;
    
    @Column({comment :"销售数量",default:0})
    sales:number;
    
    @Column({comment :"是否已删除商品" ,default:'0'})
    deleted:boolean;
    
    @Column({comment :"审核是否通过, 1.通过   2.审核失败 " ,default:false})
    approveStatus:boolean;

    @OneToMany( ()=>NovelPartEntity , novelPartEntity => novelPartEntity.Pid)


    novels: NovelPartEntity
    
}
